package com.ysd.controller;

import com.ysd.entity.User;
import com.ysd.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @RequestMapping("getUser")
    public Object getUser(){
        return userMapper.selectList(null);
    }

    @RequestMapping("addUser")
    public Object addUser(User u){
        return userMapper.insert(u);
    }

    @RequestMapping("delById")
    public Object delUserById(int id){
        return userMapper.deleteById(id); 
    }
}
